{% load i18n %}
<!--begin header-->
<link rel="stylesheet" type="text/css" href="/static/home_page/css/index.css">

<script src="/static/lib/csrf.js"></script>
<script>
        $(document).ready(function() {
            $(".new-top-fix").addClass("").removeClass("nav-default");
            $(".new-top-fix").addClass("header-positsion");
            $(".footer").addClass("footer-bg");
            $('.lang').hover(
                function(){$('.lanague').addClass('selected');},
                function () {$('.lanague').removeClass('selected');}
            );
        })
        function set_lang(code){
            var str = $("#form_lang").serialize()
            str += '&language='+code
            $.post("{%url 'set_language'%}", str, function(data){
                window.location.reload()
            });
        }
</script>
<div class="new-top-fix header-bg-img">
    <div class="new-header">
        <a class="logo" href="{%url 'index'%}">
            <img src="/static/home_page/images/logo.png"/>
        </a>
        <!--
        <ul class="nav">
            <li class="home hover"><a class="" href="{%url 'index'%}"><span>{%trans '首页'%}<i></i></span></a></li>
            <li class="trading-center"><a class="" href="{%url 'trade' %}"><span>{% trans '交易中心' %}<i></i></span></a> </li>
            <li class="piont-piont"><a class=" " href="{%url 'c2c'%}"><span>{% trans '点对点交易' %}<i></i></span></a> </li>
        </ul>
        -->
        <div class="lang">
            <span class="lang-li">
                {% get_current_language as LANGUAGE_CODE %}
                {% get_current_language as LANGUAGE_CODE %}
                {% get_available_languages as LANGUAGES %}
                {% get_language_info_list for LANGUAGES as languages %}
                {% for language in languages %}
                {% if language.code == LANGUAGE_CODE %}
                <a class="{{ language.code }}"></a>
                <em>
                {{language.name_local}}
                </em>
                {% endif %}
                {% endfor %}
            </span>
            <div class="lanague">
                <ul class="" style="position: absolute;right:-35px; top:-107px;">
                    <li class="zh-hans">
                    <a href="javascript:;" onclick="set_lang('zh-hans')">简体中文</a>
                    </li>
                    <li class="zh-hant">
                    <a href="javascript:;" onclick="set_lang('zh-hant')">繁體中文</a>
                    </li>
                    <li class="en">
                    <a href="javascript:;" onclick="set_lang('en')">English</a>
                    </li>
                    <!--
                    <li class="de">
                    <a href="javascript:;" onclick="set_lang('de')">Deutsche</a>
                    </li>
                    <li class="fr">
                    <a href="javascript:;" onclick="set_lang('fr')">français</a>
                    </li>
                    -->
                    <li class="ja">
                    <a href="javascript:;" onclick="set_lang('ja')">日本語</a>
                    </li>
                </ul>
            </div>
        </div>

        {% if user.is_authenticated %}
        <div class="top-logout">
                <!--
                <a href="{%url 'userinfo' %}">{% trans '用户中心' %} |
                -->
                <a href="{%url 'userinfo' %}" class="yellow"><i class="fa fa-user "></i>{{user.phone}}|
                <a href="/users/logout/?next={%url 'trade'%}">{% trans '退出' %} </a>
        </div>
        {% else %}
        <div class="top-login">
            <a href="/users/login?next=/{%url 'trade'%}"class="login">{% trans '登录' %}</a> |
            <a href="/users/register?next=/{%url 'users:register'%}"class="login">{% trans '注册' %}</a>
        </div>
        {% endif %}
        <ul class="nav">
            <li class="home hover"><a class="" href="{%url 'index'%}"><span>{%trans '首页'%}<i></i></span></a></li>
            <li class="trading-center"><a class="" href="{%url 'trade' %}"><span>{% trans '交易中心' %}<i></i></span></a> </li>
            <li class="piont-piont"><a class=" " href="{%url 'c2c'%}"><span>{% trans '点对点交易' %}<i></i></span></a> </li>
        </ul>
        <ul class="center-nav">
            <li class="piont-piont hover"><a class=" " href="{%url 'userinfo_balances'%}"><span>{% trans '资金中心' %}<i></i></span></a> </li>
        </ul>
        <div class="clear"></div>
    </div>
</div>
<!--end header-->

